-
Notifications
You must be signed in to change notification settings - Fork 22
feat(admin): add KeyCloak status check for SAML visibility in Admin UI #2490
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
📝 WalkthroughWalkthroughAdds explicit TypeScript types for health state and visibility, maps specific sidebar routes to health service keys (including SAML → keycloak), and updates selectors to use the new health typings; no reducer logic changes. Changes
Estimated code review effort🎯 3 (Moderate) | ⏱️ ~20 minutes
Pre-merge checks and finishing touches❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
✨ Finishing touches
🧪 Generate unit tests (beta)
📜 Recent review detailsConfiguration used: CodeRabbit UI Review profile: ASSERTIVE Plan: Pro 📒 Files selected for processing (2)
🧰 Additional context used🧬 Code graph analysis (1)admin-ui/app/routes/Dashboards/DashboardPage.tsx (1)
🔇 Additional comments (3)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actionable comments posted: 2
📜 Review details
Configuration used: CodeRabbit UI
Review profile: ASSERTIVE
Plan: Pro
📒 Files selected for processing (4)
admin-ui/app/components/Sidebar/types.ts(3 hunks)admin-ui/app/redux/features/healthSlice.ts(1 hunks)admin-ui/app/routes/Apps/Gluu/GluuAppSidebar.tsx(3 hunks)admin-ui/app/routes/Dashboards/DashboardPage.tsx(2 hunks)
🧰 Additional context used
🧬 Code graph analysis (3)
admin-ui/app/components/Sidebar/types.ts (1)
admin-ui/app/redux/features/healthSlice.ts (2)
HealthServiceKey(6-14)HealthStatusResponse(18-20)
admin-ui/app/routes/Apps/Gluu/GluuAppSidebar.tsx (2)
admin-ui/app/cedarling/types/index.ts (1)
RootState(128-135)admin-ui/app/components/Sidebar/types.ts (1)
VisibilityConditions(33-35)
admin-ui/app/routes/Dashboards/DashboardPage.tsx (1)
admin-ui/app/redux/features/healthSlice.ts (1)
HealthState(22-27)
🔇 Additional comments (8)
admin-ui/app/redux/features/healthSlice.ts (2)
6-27: Well-structured type definitions for health status management.The
HealthServiceKeyunion includes 'keycloak' which properly supports the PR objective of conditionally rendering the SAML menu based on KeyCloak availability. TheHealthStatusResponseintersection type correctly allows both known service keys with type hints and arbitrary service names for extensibility.
29-34: LGTM!The
initialStateis properly typed withHealthState, and the initial values align with the interface definition.admin-ui/app/routes/Apps/Gluu/GluuAppSidebar.tsx (3)
45-50: SAML visibility correctly tied to KeyCloak health status.The addition of
'/saml': 'keycloak'fulfills the PR objective of hiding the SAML menu item when the KeyCloak server is not running.
78-78: LGTM!The selector correctly accesses the typed
healthproperty fromhealthReducer. Type inference works properly here sinceSidebarRootStatedefines the correct shape.
159-164: Visibility filtering logic is correct.The updated lookup safely handles menus with or without paths. Menus without a matching visibility condition are shown by default, while menus with conditions (like
/saml) are shown only when the corresponding service (keycloak) reports'Running'.admin-ui/app/components/Sidebar/types.ts (2)
31-35: Type definitions correctly align with visibility conditions.The
HealthVisibilityPathunion ('/jans-lock' | '/fido/fidomanagement' | '/scim' | '/saml') matches the keys inVISIBILITY_CONDITIONSfromGluuAppSidebar.tsx, ensuring type safety between the two files.
53-55: LGTM!The
healthproperty correctly usesHealthStatusResponse, ensuring consistency with the Redux slice definition.admin-ui/app/routes/Dashboards/DashboardPage.tsx (1)
62-66: LGTM!The health-related selectors are now properly typed with
DashboardHealthRootState, providing type safety when accessingserverStatus,health, anddbStatusfrom the Redux store.
|



feat(admin): add KeyCloak status check for SAML visibility in Admin UI (#2489)
Summary
The Admin UI should only display the SAML module in the sidebar if the required KeyCloak server is installed and operational. This feature introduces a server health check for KeyCloak to determine SAML availability.
Fix Summary
Closes
Closes: #2489
Summary by CodeRabbit
✏️ Tip: You can customize this high-level summary in your review settings.